package ch.bfh.abhmcm.SoftwareEngineeringAndDesign.view.mainframe.historyRFCPanel.historyRFCPanelSubs;

import java.awt.BorderLayout;
import java.awt.Font;

import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;

import ch.bfh.abhmcm.SoftwareEngineeringAndDesign.view.mainframe.historyRFCPanel.HistoryRFCPanel;
import ch.bfh.abhmcm.SoftwareEngineeringAndDesign.view.mainframe.mainframeSub.RFCDisplayTableHistory;

public class HistoryRFCListPanel extends JPanel
{
	private static final long serialVersionUID = 1L;
	
	@SuppressWarnings("unused")
	private HistoryRFCPanel historyRFCPanel;
	private RFCDisplayTableHistory historyTable;

	public HistoryRFCListPanel(HistoryRFCPanel historyRFCPanel)
	{
		this.setLayout(new BorderLayout());
		this.historyRFCPanel = historyRFCPanel;
		this.historyTable = new RFCDisplayTableHistory();
		this.add(new LayoutHelp(), BorderLayout.CENTER);
	}
	
	public RFCDisplayTableHistory getHistoryTable()
	{
		return historyTable;
	}

	private class LayoutHelp extends JPanel
	{
		private static final long serialVersionUID = 1L;

		private LayoutHelp()
		{
			this.setLayout(new BorderLayout());
			
			Font font = new Font("marker", Font.BOLD, 12);

			JLabel l1 = new JLabel(" Aktueller Aktionsverlauf:");
			l1.setFont(font);
			this.add(new ListPanel(l1, historyTable),BorderLayout.CENTER);
		}
	}

	private class ListPanel extends JPanel
	{
		private static final long serialVersionUID = 1L;

		private ListPanel(JLabel label, RFCDisplayTableHistory historyTable)
		{
			this.setLayout(new BorderLayout());
			this.add(label, BorderLayout.NORTH);
			JScrollPane scrollPane = new JScrollPane(historyTable);
			this.add(scrollPane, BorderLayout.CENTER);
		}
	}
}